package com.yztc.love_travel.http;

import java.io.IOException;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

/**
 * Created by 周旭 on 2016/11/28.
 */

public class OKHttpUtils {

    public static void doGet(String url, Callback callback){
        OkHttpClient client = new OkHttpClient();
        Request request = new Request.Builder().url(url).build();
        Call call = client.newCall(request);
        call.enqueue(callback);
    }

    public static String getStr(Response response) throws IOException {
      return   response.body().string();
    }
}
